<div class="box-orange <? if($this->router->method == 'get_all') echo 'details_radius'; ?> <? if($this->router->method == 'index') echo 'top-arrow-box'; ?>">
    <form action="<?= base_url('hotels/search') ?>" method="GET" id="hotelsSearch">

        <h4><?= lang('search.search_hotels') ?></h4>

        <ul class="side-form wide">

            <li>
				<label><?= lang('search.destination') ?>:</label>
				<select name='dest_hot' id='dest_hot' class='dropdownized'>
					<option value='' <?= !isset($_GET['dest_hot']) || (isset($_GET['dest_hot']) && $_GET['dest_hot']) == '' ? 'selected="selected"' : '' ?>><?= lang('search.destination.choose') ?></option>
					<? foreach($destinations as $destination) : ?>
						<option value="<?= $destination->name ?>" <?= isset($_GET['dest_hot']) && $_GET['dest_hot'] == $destination->name ? 'selected="selected"' : '' ?>><?= $destination->name ?></option>
					<? endforeach; ?>
				</select>
            </li>

        </ul>

        <?if($this->lang->lang()=='ru'):?>
            <style type="text/css">
                ul.side-form label {
                    font-size: 11px;
                }
            </style>
            <?endif;?>

        <ul class="two-columns clearfix">
            <li class="left">

                <h5><?= lang('search.dates') ?></h5>

                <ul class="side-form">
                    <li>
                        <label><?= lang('search.check_in') ?></label>
                        <input type="text" class="datepicker" id="check_in" name="check_in">
                    </li>
                    <li>
                        <label><?= lang('search.check_out') ?></label>
                        <input type="text" class="datepicker" id="check_out" name="check_out">
                    </li>
                    <li>
                        <input type="checkbox" id="non_specific_dates" name="non_specific_dates" value="1" <? if (isset($session['non_specific_dates'])) echo 'checked="checked"'; ?>/>
                        <small><?= lang('search.my_dates') ?></small>
                    </li>
                </ul>

            </li>

            <li class="right">

                <h5><?= lang('search.travelers') ?></h5>

                <ul class="side-form">
                    <li>

                        <label><?= lang('adults') ?></label>

                        <select name="nr_adults" id="nr_adults" class="dropdownized" style="width:115px">
                            <option value="1" <? if(isset($session['nr_adults']) && $session['nr_adults'] == 1) echo 'selected="selected"'; ?> >1</option>
                            <option value="2" <? if(isset($session['nr_adults']) && $session['nr_adults'] == 2) echo 'selected="selected"'; ?> <? if(!isset($session['nr_adults'])) echo 'selected="selected"'; ?>>2</option>
                            <option value="3" <? if(isset($session['nr_adults']) && $session['nr_adults'] == 3) echo 'selected="selected"'; ?>>3</option>
                            <option value="4" <? if(isset($session['nr_adults']) && $session['nr_adults'] == 4) echo 'selected="selected"'; ?>>4</option>
                            <option value="5" <? if(isset($session['nr_adults']) && $session['nr_adults'] == 5) echo 'selected="selected"'; ?>>5</option>
                        </select>

                    </li>

                    <li>
                        <label><?= lang('children') ?></label>
                        <select class="dropdownized" name="nr_childrens" style="width:115px" id="nr_childrens">

                            <option value="0" <? if(isset($session['nr_childrens']) && $session['nr_childrens'] == 0) echo 'selected="selected"'; ?> <? if(!isset($session['nr_childrens'])) echo 'selected="selected"'; ?>>0</option>
                            <option value="1" <? if(isset($session['nr_childrens']) && $session['nr_childrens'] == 1) echo 'selected="selected"'; ?>>1</option>
                            <option value="2" <? if(isset($session['nr_childrens']) && $session['nr_childrens'] == 2) echo 'selected="selected"'; ?>>2</option>
                            <option value="3" <? if(isset($session['nr_childrens']) && $session['nr_childrens'] == 3) echo 'selected="selected"'; ?>>3</option>
                            <option value="4" <? if(isset($session['nr_childrens']) && $session['nr_childrens'] == 4) echo 'selected="selected"'; ?>>4</option>
                            <option value="5" <? if(isset($session['nr_childrens']) && $session['nr_childrens'] == 5) echo 'selected="selected"'; ?>>5</option>

                        </select>
                    </li>
                    <li class="col clearfix ages" <? if(isset($session['nr_childrens']) && $session['nr_childrens'] != 0) echo 'style="display:block"'; ?>>

                        <label><?= lang('search.ages') ?></label>

                        <div class="left mr10 age-1"><input type="text" name="ages[]" class="positive-integer" value="<? if(isset($session['ages'][0])) echo $session['ages'][0]; ?>" /></div>  
                        <div class="left mr10 age-2"><input type="text" name="ages[]" class="positive-integer" value="<? if(isset($session['ages'][1])) echo $session['ages'][1]; ?>" /></div>  
                        <div class="left mr10 age-3"><input type="text" name="ages[]" class="positive-integer" value="<? if(isset($session['ages'][2])) echo $session['ages'][2]; ?>" /></div>  
                        <div class="left mr10 age-4"><input type="text" name="ages[]" class="positive-integer" value="<? if(isset($session['ages'][3])) echo $session['ages'][3]; ?>" /></div>  
                        <div class="left mr10 age-5"><input type="text" name="ages[]" class="positive-integer" value="<? if(isset($session['ages'][4])) echo $session['ages'][4]; ?>" /></div>

                    </li>
                </ul>
            </li>
        </ul>

        <input type="submit" value="<?= lang('search.show.best.prices') ?>" class="form-button button-search" style="margin-top: 10px;">

    </form>

</div>
<script type="text/javascript">

    var doResetAges = false;
    var nr_children = 0;  

    <? if(!isset($session['ages'][0])): ?> 

        doResetAges = true;    
        <?
            endif;

        if(isset($session['nr_childrens'])):
        ?>

        nr_children = '<?= $session['nr_childrens'] ?>';
        <? endif; ?>

</script>